<template>
  <div class="index" id="index">
  </div>
</template>

<script>
export default {
  name: "index",
  data() {
    return {
      
    };
  },
  mounted() {
  },
  beforeCreate(){
    console.log('进入乐享')
    console.log(this.$common.isIOS())
    console.log((location.href.includes('icebartech')||location.href.includes('http://localhost')))
    console.log(this.$common.getQueryString('type'))
    console.log('进入乐享')
    const API = (location.href.includes('icebartech')||location.href.includes('http://localhost'))
    ?'https://enjoyshop.icebartech.com/h5'
    :'https://www.lexiangfuli.vip/wechat/'
    // if(this.$common.getQueryString('type')=='phone'){
    //   window.location.href =API+ '#/phone'
    // }
    // alert(this.$common.getQueryString('type'))
    console.log(this.$common.isIOS())
    if(this.$common.getQueryString('type')=='phone'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=phone#/phone'
      }else {
        this.$router.push('/phone')
      }
    }else if(this.$common.getQueryString('type')=='password'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=password#/password'
      }else {
        this.$router.push('/password')
      }
    }else if(this.$common.getQueryString('type')=='password1'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=password1#/password?classtype=birPool'
      }else {
        this.$router.push('/password?classtype=birPool')
      }
    }else if(this.$common.getQueryString('type')=='password2'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=password2#/password?classtype=newYearW'
      }else {
        this.$router.push('/password?classtype=newYearW')
      }
    }else if(this.$common.getQueryString('type')=='password3'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=password3#/password?classtype=building'
      }else {
        this.$router.push('/password?classtype=building')
      }
    }else if(this.$common.getQueryString('type')=='store'){
      if(this.$common.isIOS()){
        window.location.href =API+ '?type=store#/password?store=store'
      }else {
        this.$router.push('/password?store=store')
      }
    }else {
      setTimeout(() => {
        this.hrefElse()
      }, 0);
    }
  },
  created() {},
  methods: {
    hrefElse(){
      if(location.href.indexOf('store')>-1){
        this.$router.push('/password?store=store')
      }else if(location.href.indexOf('phone#')>-1){
        this.$router.push('/phone')
      }else if(location.href.indexOf('password#')>-1){
        this.$router.push('/password')
      }else if(location.href.indexOf('password1#')>-1){
        this.$router.push('/password?classtype=birPool')
      }else if(location.href.indexOf('password2#')>-1){
        this.$router.push('/password?classtype=newYearW')
      }else if(location.href.indexOf('password3#')>-1){
        this.$router.push('/password?classtype=building')
      }else {
        this.$router.push('/phone')
      }
    }
  },
  components: {}
};
</script>

<style lang="less">

</style>
